package com.bruce.practice.jvm;

import java.io.ByteArrayOutputStream;
import java.io.InputStream;

/**
 * @author luotuan
 * @Description
 * @create 2020-09-03 10:51
 **/
public class MyClassLoader extends ClassLoader {
    private String mayName;

    public MyClassLoader(String mayName) {
        this.mayName = mayName;
    }

    @Override
    protected Class<?> findClass(String name) throws ClassNotFoundException {
        byte[] data = loadClassData(name);
        return this.defineClass(name,data,0,data.length);
    }

    private byte[] loadClassData(String clsName){
        byte[] data = null;
        InputStream in = null;
        ByteArrayOutputStream out = new ByteArrayOutputStream();
        clsName = clsName.replace(".","/");

        return data;
    }
}
